/** CS2340 Spring 2011 Project
 *  Team: 40 Jiggawatt Hard Driver
 *  Suk Hwan Hong
 *  Rhys Saraceni
 *  Travis Cooper
 *  Luke Stubb
 *
 * @author 40 Jiggawatt Hard Driver
 * @version 1.0 
 */

package edu.gatech.jiggawatt.office.client;

import java.awt.EventQueue;
import javax.swing.JFrame;
import edu.gatech.jiggawatt.office.gui.LoginFrame;
import edu.gatech.jiggawatt.office.presenter.Presenter;

/**
 * Client class
 * @author 40 Jiggawatt Hard Driver
 * @version 1.0 *
 */
public class Client {

	private Presenter presenter;
	private String serverIP = "127.0.0.1"; // $codepro.audit.disable stringLiterals
	private String serverPort = "12345"; // $codepro.audit.disable stringLiterals

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
					Client client = new Client(); // $codepro.audit.disable variableUsage
			}
		});
	}

	/**
	 * Creates presenter and show login screen (program start up)
	 */
	public Client() {
		presenter = new Presenter(serverIP, serverPort);
		
		showLoginScreen();
	}

	/**
	 * shows login screen
	 */
	private void showLoginScreen() {
		JFrame loginFrame = new LoginFrame(presenter);
		loginFrame.setVisible(true);
	}
	

	/**
	 * returns client info
	 * @return client info including server ip it is using and server port
	 */
	public String toString()
	{
		return "Client with server info: " + serverIP + " serverPort"; // $codepro.audit.disable stringLiterals
	}
}